
#include <stdio.h>
int main ()
{
  char s1[100], s2[100];	// two character arrays
  int i, j;
  printf ("Enter first string:\n");
  fgets (s1, 100, stdin);	// Read string1 from stdin, of maximum length 100 
  printf ("Enter second string:\n");
  fgets (s2, 100, stdin);	// Read string2 from stdin, of maximum length 100 
  
  // This loop is to store the length of str1 in i
  for (i = 0; s1[i] != '\0'; ++i);
  
  --i;				// Last character would be newline, skip it.
  
  // This loop would concatenate the string str2 at the end of str1
  for (j = 0; s2[j] != '\0'; ++j, ++i)
    {
      s1[i] = s2[j];
    }
  s1[--i] = '\0';			// Append NULL character at end to mark end of string
  printf ("After concatination:%s", s1);

  return 0;
}

    
